﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE proc_Order_CheckAnalyse
(
	@OId uniqueidentifier,
	@Analyse nvarchar(30)
)
AS
BEGIN
	Declare @EName nvarchar(30)
	Update [Order] Set Analyse=@Analyse Where OId=@OId And StateId=2 And Analyse Is Null

	Set @EName = IsNull((Select Analyse From [Order] Where OId=@OId),'')
	Select @EName As Analyse
END